<template>
  <div class="staff-detail-container br-20">
    <div class="user">
      <svg-icon icon-class="awatar"></svg-icon>
      <div>
        <h2>{{ username }}</h2>
        <div>{{ email }}</div>
      </div>
    </div>
    <div class="info">
      <div class="info-base br-30">
        <h3>基礎信息</h3>
        <div class="info-base-list">
          <div class="info-base-list-item">
            <span>姓名</span>
            <span>{{ userinfo.name }}</span>
          </div>
          <div class="info-base-list-item">
            <span>郵箱</span>
            <span>{{ userinfo.name }}</span>
          </div>
          <div class="info-base-list-item">
            <span>所屬部門</span>
            <span>{{ userinfo.name }}</span>
          </div>
          <div class="info-base-list-item">
            <span>崗位</span>
            <span>{{ userinfo.name }}</span>
          </div>
          <div class="info-base-list-item">
            <span>入職日期</span>
            <span>{{ userinfo.name }}</span>
          </div>
        </div>
      </div>
      <div class="info-permission br-30">
        <h3>使用者權限</h3>
        <div class="role">{{ role }}</div>
        <div class="permission">
          <div class="permission-item" v-for="value in permissionListData" :key="value">
            <svg-icon icon-class="success"></svg-icon>
            <span>{{ value }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'staff-detail',
  data() {
    return {
      username: '張三',
      email: 'user@example.com',
      userinfo: {
        name: '張三'
      },
      role: '超級管理員',
      permissionListData: ['系統設定', '更新權限', '用戶管理', '查看權限']
    }
  }
}
</script>

<style scoped lang="less">
.staff-detail-container {
  background: #fff;
  padding: 33px 38px;
  .user {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
    .svg-icon {
      width: 80px;
      height: 80px;
      margin-right: 20px;
    }
    > div {
      h2 {
        margin: 0 0 7px 0;
        font-size: 24px;
        line-height: 29px;
        color: #0f0a2b;
        font-weight: normal;
      }
      div {
        font-size: 14px;
        line-height: 17px;
        color: #838383;
      }
    }
  }
  .info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    &-base,
    &-permission {
      background: rgba(60, 88, 252, 0.04);
      flex: auto;
      padding: 24px 40px;
      box-sizing: border-box;
      //min-width: 595px;
      height: 335px;
      &:first-child {
        margin-right: 15px;
      }
      h3 {
        font-size: 24px;
        line-height: 34px;
        color: #1c1d1f;
        margin: 0 0 14px 0;
      }
      &-list {
        padding-top: 16px;
        &-item {
          line-height: 22px;
          color: #0f0a2b;
          font-size: 18px;
          display: flex;
          justify-content: flex-start;
          align-items: center;
          margin-bottom: 24px;
          span:first-child {
            font-size: 16px;
            color: rgba(15, 10, 43, 0.5);
            min-width: 120px;
          }
        }
      }
    }
    &-permission {
      .role {
        width: 175px;
        box-sizing: border-box;
        font-size: 18px;
        line-height: 22px;
        color: #fff;
        text-align: center;
        background: #f2b059;
        padding: 6px 32px;
        border-radius: 40px;
        margin-bottom: 27px;
      }
      .permission {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        &-item {
          width: 50%;
          line-height: 26px;
          margin-bottom: 15px;
          .svg-icon {
            font-size: 26px;
            vertical-align: middle;
            margin-right: 11px;
          }
          span {
            font-size: 18px;
            color: #0f0a2b;
            line-height: 26px;
            vertical-align: middle;
          }
        }
      }
    }
  }
}
</style>
